package day07;

public class School {

    // 成员属性
    private String name;
    private int num;
    // private String library; // 私有属性 没有共享的特点
    public static String library = "";// 共享属性

    // 方法
    public void show() {
        System.out.println("学校名称：" + name);
        System.out.println("图书馆：" + library);
        System.out.println("学生人数：" + num);
    }

    public void setLibrary(String library) {
        // 通过对象调用共享属性
        this.library = library;
    }

    // 构造器
    public School() {
    }

    // 全参构造器
    public School(String name, String library, int num) {
        this.name = name;
        this.library = library;
        this.num = num;
    }
}
